package com.woniuxy01;

/**
 * @author 作者
 * @create 2025-09-04 16:16
 */
public class Cat extends Animal {

    private int health;



    public Cat() {
    }

    public Cat(String name, int age,int health) {
        super(name,age);
        this.health = health;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }



    public String toString(){
        return super.toString()+",health:"+health;
    }

    @Override
    public void eat() {
        System.out.println("cat eat fish");
    }

    public void playBall(){
        System.out.println("cat play ball");
    }
}
